package com.cai.servlet.common.user;

import com.cai.dao.DetailedTopicDao;
import com.cai.dao.impl.DetailedTopicDaoImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 获取用户选项栏数据
 *
 * @author RuoLi
 */
@WebServlet(name = "ServletGetUserSelectInfo", value = "/common/GetUserSelectInfo")
public class ServletGetUserSelectInfo extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("utf-8");
        resp.setContentType("text/html;charset=utf-8");
        DetailedTopicDao dao = new DetailedTopicDaoImpl();
        String param=req.getParameter("param");
        resp.getWriter().write(dao.getUserSelectData(param));
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doGet(req, resp);
    }
}
